package com.chatplus.application.domain.response;

import com.chatplus.application.domain.dto.UserCustomChatConfigDto;
import com.chatplus.application.json.Int64AsString;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 账号详细信息
 */

@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class AccountSessionResponse implements Serializable {
    @Serial
    private static final long serialVersionUID = 6429344185772985945L;

    /**
     * id : 100
     * created_at : 12321
     * updated_at : 123123
     * username : 15302789406
     * nickname : 极客学长@281216
     * avatar : /images/avatar/user.png
     * salt : bh94d1rv
     * total_tokens : 30466
     * calls : 9566
     * img_calls : 5
     * chat_config : {"api_keys":{"Azure":"","ChatGLM":"","OpenAI":""}}
     * chat_roles : ["teacher","psychiatrist"]
     * chat_models : ["eb-instant","completions_pro","generalv2","general","chatglm_pro","gpt-3.5-turbo-16k","chatglm_lite","chatglm_std"]
     * expired_time : 0
     * status : true
     * last_login_at : 1705627592
     * last_login_ip : 116.1.249.206
     * vip : false
     * token : 30466
     */

    @JsonProperty("id")
    @JsonSerialize(using = Int64AsString.class)
    private Long id;
    @JsonProperty("created_at")
    @JsonSerialize(using = Int64AsString.class)
    private Long createdAt;
    @JsonProperty("updated_at")
    @JsonSerialize(using = Int64AsString.class)
    private Long updatedAt;
    @JsonProperty("username")
    private String username;
    @JsonProperty("nickname")
    private String nickname;
    @JsonProperty("avatar")
    private String avatar;
    @JsonProperty("total_token")
    @JsonSerialize(using = Int64AsString.class)
    private Long totalToken;

    @JsonProperty("calls")
    private Integer calls;

    @JsonProperty("img_calls")
    private Integer imgCalls;

    @JsonProperty("chat_config")
    private UserCustomChatConfigDto chatConfig;
    @JsonProperty("expired_time")
    @JsonSerialize(using = Int64AsString.class)
    private Long expiredTime;
    @JsonProperty("status")
    private boolean status;
    @JsonProperty("last_login_at")
    @JsonSerialize(using = Int64AsString.class)
    private Long lastLoginAt;
    @JsonProperty("last_login_ip")
    private String lastLoginIp;
    @JsonProperty("vip")
    private boolean vip;
    @JsonProperty("token")
    private Long token;
    @JsonProperty("chat_roles")
    private List<String> chatRoles;
    @JsonProperty("chat_models")
    private List<String> chatModels;
    @JsonProperty("admin")
    private Boolean admin;
}
